/*! 全局修饰 */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

::-webkit-scrollbar {
  width: 8px;
  height: 5px
}


::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color);
  background-image: -webkit-linear-gradient(45deg, hsla(0, 0%, 100%, .4) 25%, transparent 0, transparent 50%, hsla(0, 0%, 100%, .4) 0, hsla(0, 0%, 100%, .4) 75%, transparent 0, transparent);
  border-radius: 2em;
}

::-webkit-scrollbar-track {
  background-color: rgba(73, 177, 245, .2);
  border-radius: 2em;
}

::selection {
  background: #00c4b6;
  color: #f7f7f7;
}

body {
  position: relative;
  min-height: 100%;
  color: var(--font-color);
  font-size: var(--global-font-size);
  font-family: var(--global-font-family);
  line-height: 2;
  -webkit-tap-highlight-color: transparent;
  background: var(--global-bg);
  background-position: center;
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}

a {
  color: #99a9bf;
  text-decoration: none;
  word-wrap: break-word;
  transition: all 0.2s;
  overflow-wrap: break-word;

}

img {
  max-width: 100%;
  transition: all 0.2s;
}

svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  font-size: 20px;
}

ol {
  list-style: none;
}

hr {
  position: relative;
  margin: 40px auto;
  border: 2px dashed var(--hr-border);
  width: calc(100% - 4px);
  box-sizing: content-box;
  height: 0;
  overflow: visible;

  &:before {
    //noinspection CssNoGenericFontName
    font-family: "by-font";
    position: absolute;
    top: -10px;
    left: 5%;
    z-index: 1;
    color: var(--hr-before-color);
    content: "\e622";
    font-size: 20px;
    line-height: 1;
    transition: all 1s ease-in-out;

    //可能拆分
    display: inline-block;
    font-weight: 600;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
  }
}

.by-font {
  display: inline-block;
  font-size: initial;
}

.by_card_widget {
  border-radius: 25px;
  background: var(--card-bg);
  box-shadow: var(--card-box-shadow);
  transition: all .3s;

  &:hover {
    box-shadow: var(--card-hover-box-shadow);
  }
}

.by_empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px 0;
  margin: 0 0 20px;
  color: #888;

  .by_empty_icon {
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
    fill: #888;
  }

}

.by_btn {
  display: block;
  margin-top: 0.7rem;
  background-color: var(--btn-bg);
  color: var(--btn-color);
  text-align: center;
  line-height: 2.4;
  border-radius: 25px;
  overflow: hidden;
  transition: color 1s;
  position: relative;
  z-index: 1;

  &:before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: var(--btn-hover-color);
    content: '';
    transition: transform .5s ease-out;
    transform: scaleX(0);
    transform-origin: 0 50%;
  }

  &:hover:before {
    transition-timing-function: cubic-bezier(.45, 1.64, .47, .66);
    transform: scaleX(1);
  }

}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webkit_box {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.center {
  text-align: center;
}

.by_main, .by_footer {
  animation: bottom-top 1s;
}

.img_cover {
  width: 100%;
  height: 100%;
  transition: filter 375ms ease-in .2s, transform .6s;
  object-fit: cover;
}


/*！ 小部件*/

.by_rightside {
  position: fixed;
  right: -48px;
  bottom: 40px;
  z-index: 200;
  transition: all .5s;


  &_config_show, &_config_hide {
    > button {
      display: block;
      margin-bottom: 5px;
      width: 35px;
      height: 35px;
      border-radius: 5px;
      background-color: var(--btn-bg);
      color: var(--btn-color);
      text-align: center;
      font-size: 16px;
      line-height: 35px;
      border: none;
      cursor: pointer;
    }

    .rightside_config {
      i {
        animation: fa-spin 2s linear infinite;
      }
    }
  }

  &_show {
    opacity: 0.8;
    transform: translateX(-58px);
  }
}

/*！ 小部件结束*/

.by {


  /*! 头部 */

  &_header {
    position: relative;
    width: 100%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: all .5s;
    z-index: 99;
    height: 400px;
    animation: header-effect 1s;

    &:before {
      position: absolute;
      top: 0;
      left: 0;
      display: block;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, .5);
      content: '';
    }

    /*！ 移动端 sidebar*/

    &_sidebar {
      display: none;

      &_menus {
        position: fixed;
        top: 0;
        right: -300px;
        z-index: 103;
        overflow-x: hidden;
        overflow-y: auto;
        width: 300px;
        height: 100%;
        background: var(--sidebar-bg);
        transition: all .5s;

        ul, li {
          list-style: none;
        }

        .by_user_avatar {
          margin: 20px auto;
          overflow: hidden;
          width: 110px;
          height: 110px;
          border-radius: 70px;
        }

        .by_user_data {
          display: table;
          padding: 0 8px;
          width: 100%;
          table-layout: fixed;

          &_item {
            display: table-cell;

            .headline {
              color: var(--font-color);
            }

            .length_num {
              color: var(--text-highlight-color);
              font-size: 1.2rem;
            }
          }
        }


        hr {
          margin: 20px auto;
        }

        &_items {
          padding: 0 10px 40px;
          margin: 0;
          list-style: none;
        }

        &_item {
          position: relative;
          display: block;
          padding: 8px 30px 8px 22px;
          list-style: none;


          a, i {
            color: var(--font-color);
            font-size: 1rem;
          }

          a {
            width: 100%;
            height: auto;
            display: inline-block;
          }

          .first {
            width: 10%;
            text-align: left;
            display: inline-block;
          }

          .last {
            position: absolute;
            top: 0.4rem;
            right: 18px;
            transition: transform .3s;
          }

          &_child {
            margin: 0;
            padding: 0;
            list-style: none;
            display: none;

            a {
              position: relative;
              display: block;
              padding: 6px 30px 6px 28px;
              color: var(--font-color);
              font-size: 1rem;
            }
          }
        }


      }

      &_open {
        .by_header_sidebar_mask {
          display: block;
          animation: 0.5s ease 0s 1 normal none running to_show;
        }

        .by_header_sidebar_menus {
          transform: translate3d(-100%, 0, 0);


          .by_user_avatar {
            animation: sidebarItem .2s;
          }

          .by_user_data {
            animation: sidebarItem .4s;
          }

          hr {
            animation: sidebarItem .6s;
          }

          &_items {
            animation: sidebarItem .8s;
          }


          .by_child_show {
            i.last {
              transform: rotate(-90deg);
            }
          }
        }

      }

      &_mask {
        position: fixed;
        z-index: 102;
        width: 100%;
        height: 100%;
        display: none;
        background: rgba(0, 0, 0, .8);
        animation: 0.5s ease 0s 1 normal none running to_hide;
      }

    }

  }

  &_nav {
    position: absolute;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 36px;
    width: 100%;
    height: 60px;
    font-size: 1.3em;
    transition: all .5s;
    animation: headerNoOpacity 1s;

    a {
      color: var(--light-grey);
    }
  }

  &_blog_title {
    flex: 1;
    text-shadow: 2px 2px 4px rgb(0 0 0 / 15%);
    font-weight: bold;
  }

  &_site {
    position: relative;
    padding-bottom: 0.3rem;
    text-shadow: 0.05rem 0.05rem 0.1rem rgb(0 0 0 / 30%);
    font-size: 0.78em;
    cursor: pointer;

    i {
      font-weight: 900;
    }

    &:not(.child):after {
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: -1;
      width: 0;
      height: 3px;
      background-color: #80c8f8;
      content: '';
      transition: all 0.3s ease-in-out;
    }

    &:hover:after {
      width: 100%;
    }

    &_info {
      position: absolute;
      top: 43%;
      padding: 0 10px;
      width: 100%;
    }

    &_title {
      font-size: 2.85em;
      color: var(--white);
    }

    &_subtitle {
      font-size: 1.72em;
      color: var(--light-grey);
    }

    &_social_icons {
      margin: 0 auto;
      width: 300px;
      display: none;

      a {
        margin: 0 3px;
        color: var(--light-grey);
        text-shadow: 2px 2px 4px rgb(0 0 0 / 15%);

        i {
          font-size: 1.8em;
        }
      }
    }

  }

  &_search, &_toggle_menu {
    display: inline;
  }

  &_toggle_menu {
    padding: 2px 0 0 6px;
    vertical-align: top;
    display: none;
  }

  &_menus {
    display: inline;

    &, li {
      list-style: none;
    }
  }

  &_menu_item {
    position: relative;
    display: inline-block;
    padding: 0 0 0 0.7rem;

    &:hover &_child {
      display: block;

    }

    &_child {
      position: absolute;
      right: 0;
      display: none;
      margin-top: 8px;
      width: max-content;
      background-color: var(--sidebar-bg);
      animation: sub_menus 0.3s 0.1s ease both;
      box-shadow: 2px 2px 8px rgb(0 0 0 / 20%);
      border-radius: 12px;

      &:before {
        position: absolute;
        top: -8px;
        left: 0;
        width: 100%;
        height: 20px;
        content: '';
      }

      li {
        &:first-child {
          border-radius: 12px 12px 0 0;
        }

        &:last-child {
          border-radius: 0 0 12px 12px;
        }
      }

      li:hover {
        background: var(--text-bg-hover);
      }


      .child {
        display: inline-block;
        padding: 0.3rem 0.7rem;
        width: 100%;
        color: var(--font-color);
        text-shadow: none;
      }
    }


  }


  /*! 头部结束 */

  /*! 内容 */

  &_main {
    display: flex;
    margin: 0 auto;
    padding: 2rem 15px;
    max-width: 1200px;
    position: relative;
    z-index: 88;
  }

  &_container {
    width: 75%;
    transition: all 0.3s;
    align-self: flex-start;
    padding: 50px 40px;
    border-radius: 25px;
    background: var(--card-bg);
    box-shadow: var(--card-box-shadow);

    a:hover {
      color: #49b1f5 !important;
    }

    p {
      line-height: 2rem;
      margin-bottom: 1rem;
    }

    .by_posts {
      &_item {
        display: flex;
        flex-direction: row;
        align-items: center;
        height: 20em;

        &:not(:first-child) {
          margin-top: 1rem;
        }
      }

      &_cover {
        overflow: hidden;
        width: 45%;
        height: 100%;
        border-radius: 25px 0 0 25px;

        img {
          width: 100%;
          height: 100%;
          transition: all 0.6s;
          object-fit: cover;

          &:hover {
            transform: scale(1.1);
          }
        }
      }

      &_info {
        display: inline-block;
        overflow: hidden;
        padding: 0 35px;
        width: 55%;
      }

      &_title {
        margin-bottom: 0.3rem;
        color: var(--text-highlight-color);
        font-size: 1.72em;
        line-height: 1.4;
        transition: all 0.2s ease-in-out;
        -webkit-line-clamp: 2;
      }

      &_meta {
        color: #858585;
        font-size: 90%;

        a {
          color: #858585;

          &:hover {
            color: #49b1f5;
          }
        }
      }

      &_wrap {
        > div {
          display: inline-flex;
          align-items: center;
        }

        .separator {
          margin: 0 0.3rem;
        }

        .ato {
          a {
            margin-right: 5px;
          }
        }

        svg {
          width: auto;
          height: 16px;
          margin-right: 5px;
        }

        .sticky span:not(.separator) {
          color: #ff7242;
        }
      }

      &_content {
        margin-top: 0.3rem;
        -webkit-line-clamp: 3;
      }

    }
  }

  /*! 侧边栏 */

  &_aside {
    width: 25%;
    padding-left: 15px;

    .by_card_widget {
      padding: 1rem 1.2rem;
      margin-top: 1rem;

      &:not(.by_catalogue):first-child {
        margin-top: 0;
      }
    }

    .by_user {
      &_avatar {
        overflow: hidden;
        margin: 0 auto;
        width: 110px;
        height: 110px;
        border-radius: 70px;
      }

      &_name {
        font-weight: 500;
        font-size: 1.57em;
      }

      &_desc {
        margin-top: -0.3rem;
      }

      &_data {
        display: table;
        margin: 14px 0 4px;
        width: 100%;
        table-layout: fixed;

        &_item {
          display: table-cell;

          .headline {
            color: var(--font-color);
            font-size: 1rem;
          }

          .length-num {
            margin-top: -0.42em;
            color: var(--text-highlight-color);
            font-size: 1.2rem;
          }

        }
      }

      &_social_icons {
        margin: 0.3rem 0 -0.3rem;

        a {
          margin: 0 0.5rem;
          color: var(--font-color);
          font-size: 1.4em;
          cursor: pointer;

          svg {
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
            font-size: 20px;
          }
        }
      }
    }

    .by_btn i {
      margin-right: 5px;
    }

    .by_card_icon_title {
      padding-bottom: 6px;
      font-size: 1rem;


      i {
        font-size: 1.3rem;
      }

      span {
        margin-left: 3px;
      }

      .by_card_title_announcement_animation {
        display: inline-block;
        color: red;
        animation: announ_animation 0.8s linear infinite;
      }
    }

    .by_catalogue {
      .toc {
        padding: 0 1rem;

        .toc-link {
          display: block;
          padding-left: 0.3rem;
          border-left: 3px solid transparent;
          color: var(--toc-link-color);
          transition: all .2s ease-in-out;
          border-radius: 8px;

          &.is-active-link {
            border-left-color: #69b469;
            background: #9c9;
            color: #fff;
          }
        }
      }
    }

    .by_post_sticky {
      position: sticky;
      top: 20px;
      transition: top .5s;
    }

    .by_latest {
      &_list_item {
        display: flex;
        align-items: center;
        padding: 6px 0;

        //&:first-child {
        //  padding-top: 0;
        //}
        & {
          border-bottom: 1px dashed #f5f5f5;
        }

        .thumbnail {
          overflow: hidden;
          width: 4rem;
          height: 4rem;
          border-radius: 5px;

          img {
            width: 100%;
            height: 100%;
            transition: all .6s;
            object-fit: cover;
          }
        }

        .content {
          flex: 1;
          padding-left: 10px;
          word-break: break-all;

          &_title {
            color: var(--font-color);
            font-size: 95%;
            line-height: 1.5;
            -webkit-line-clamp: 1;

            &:hover {
              color: #49b1f5;
            }
          }

          time {
            display: block;
            color: #858585;
            font-size: 85%;
          }
        }
      }
    }

    .by_aside_categories {

      &_item {
        position: relative;
        display: flex;
        flex-direction: row;
        padding: 3px 10px 3px 25px;
        color: var(--font-color);
        transition: all .4s;

        &:not(:last-child) {
          margin-bottom: .5rem;
        }

        &:before {
          position: absolute;
          top: 0.6rem;
          left: 0;
          width: 0.43rem;
          height: 0.43rem;
          border: 0.215rem solid #49b1f5;
          border-radius: 0.43rem;
          background: 0 0;
          content: '';
          cursor: pointer;
          transition: all .3s ease-out;

        }

        &:hover:before {
          border-color: #fc4b4b;
        }

        span:first-child {
          flex: 1;
        }

        &:hover {
          padding: 3px 15px 3px 30px;
          color: #49b1f5;
        }

      }
    }

    .by_aside_tags {
      &_list a {
        display: inline-block;
        padding: 0 0.2rem;
      }
    }
  }

  /*! 侧边栏 结束*/

  /*！ 尾部*/

  &_footer {
    width: 100%;
    margin: 0 auto;
    padding: 1.3rem 2rem;
    color: #909399;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(3px);
    transition: all .3s;

    p {
      margin: 0;
    }

    a {
      margin: 0 5px;
    }

    .by_a_powered {
      font-weight: 600;
      color: #007cff;
    }

    .by_a_theme {
      font-weight: 600;
      color: #fc4b4b;
    }
  }

  /*！ 尾部结束*/


  /*！ 翻页*/

  &_pagination {
    margin: 20px 0;
    text-align: center;

    &_item {
      display: inline-block;
      margin: 0 6px;
      width: 2.5em;
      height: 2.5em;
      line-height: 2.5em;
      border-radius: 8px;
      background: var(--card-bg);
      box-shadow: var(--card-box-shadow);
      transition: all .3s;

      a {
        width: 100%;
        height: 100%;
        display: block;
        border-radius: 8px;
      }

      &:not(.active) a:hover {
        background: var(--btn-hover-color);
        color: var(--btn-color);
      }
    }

    .active a {
      background: #00c4b6;
      color: var(--white);
    }

  }

  /*！ 翻页结束*/


  /*! 首页 */

  &_index {

  }

  &_archives {

  }

  &_categories {

  }

  &_tag {

  }

  &_post {

  }

  &_journals {

  }

}


/*! 覆盖样式 */
/*！ 设置*/
html #Butterfly {

  .w-100 {
    width: 100%;
  }

  .h-100 {
    height: 100%;
  }

  .nav_font_color_dark {
    &:before {
      display: none;
    }

    a {
      color: var(--font-color);
      text-shadow: none;
    }
  }


  .by_nav_fixed .by_nav {
    position: fixed;
    top: -60px;
    z-index: 91;
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 5px 6px -5px rgb(133 133 133 / 60%);
    transition: transform .2s ease-in-out, opacity .2s ease-in-out;

    a {
      color: var(--font-color);
      text-shadow: none;
    }
  }

  .by_nav_visible .by_nav {
    transform: translate3d(0, 100%, 0);
    transition: all .5s;
  }

  .none-card {
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  code, pre {
    font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  }


  code:not([class]) {
    padding: 2px 4px;
    background: rgba(27, 31, 35, .05);
    color: #f47466;
    font-family: consolas, Menlo, "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
  }

  .code-toolbar {
    .toolbar {
      pointer-events: none;
      opacity: 1;
      left: 0;
      right: 0;
      top: 0;
      z-index: unset;
      height: 30px;
      line-height: 30px;
      text-align: center;

      &-item {
        opacity: 1;
        pointer-events: none;

        span {
          font-weight: bold;
          font-size: 14px;
          color: #999;
          background: none;
          border: none;
          box-shadow: none;
        }

        &:last-child {
          display: none;
        }
      }
    }

    pre[class*="language-"] code[class*="language-"] .token.operator {
      background: none;
    }

    pre[class*="language-"] {
      position: relative;
      margin: 0;
      padding: 30px 0 0;
      user-select: auto;
      font-size: 16px;
      overflow: hidden;
      white-space: pre;
      text-shadow: none;
      border-radius: 8px;

      &:before {
        content: "";
        position: absolute;
        top: 9px;
        left: 12px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #fc625d;
        box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
        z-index: 1;
      }

      &:after {
        position: absolute;
        top: 30px;
        z-index: 1;
        content: "";
        width: 100%;
        height: 1px;
        background: #d8d8d8;
        mix-blend-mode: overlay;
      }


      code[class*="language-"] {
        display: block;
        margin-bottom: 0;
        overflow-x: auto;
        padding: 0 12px 12px 18px;
        border-radius: 0 0 8px 8px;
        text-shadow: none;
      }

      &.line-numbers code {
        padding: 12px 12px 12px 54px;
      }

      .line-numbers-rows {
        left: 0;
        top: 0;
        bottom: 0;
        padding-top: 12px;
        border: none;
      }
    }

    .by_code_copy, .by_code_expander {
      position: absolute;
      top: 5px;
      right: 10px;
      z-index: 5;
      font-weight: bold;
      font-size: 14px;
      color: #999;
      cursor: pointer;
    }

    .by_code_expander {
      right: 40px;
      transition: transform .2s;
    }


    .by_code_expander_close {
      transform: rotate(90deg);
    }

    .by_code_close {

      .by_code_expander {
        transform: rotate(90deg);
      }

      code[class*="language-"] {
        display: none !important;
      }
    }


  }
}




